/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface DeviceInfo extends BasicModel<DeviceInfo> {
  deviceSerial?: string; // 设备序列号
  deviceName?: string; // 设备名称
  deviceLocation?: string; // 设备位置
  appkey?: string; // appkey
  secret?: string; // secret
  previewUrlHd?: string; // 播放地址(高清)
  previewUrlSd?: string; // 播放地址(流畅)
  uikitTemplate?: string; // UIKIT主题模板
}

export const deviceInfoList = (params?: DeviceInfo | any) =>
  defHttp.get<DeviceInfo>({ url: adminPath + '/orther/device/deviceInfo/list', params });

export const deviceInfoListData = (params?: DeviceInfo | any) =>
  defHttp.post<Page<DeviceInfo>>({ url: adminPath + '/orther/device/deviceInfo/listData', params });

export const deviceInfoForm = (params?: DeviceInfo | any) =>
  defHttp.get<DeviceInfo>({ url: adminPath + '/orther/device/deviceInfo/form', params });

export const deviceInfoSave = (params?: any, data?: DeviceInfo | any) =>
  defHttp.postJson<DeviceInfo>({ url: adminPath + '/orther/device/deviceInfo/save', params, data });

export const deviceInfoDisable = (params?: DeviceInfo | any) =>
  defHttp.get<DeviceInfo>({ url: adminPath + '/orther/device/deviceInfo/disable', params });

export const deviceInfoEnable = (params?: DeviceInfo | any) =>
  defHttp.get<DeviceInfo>({ url: adminPath + '/orther/device/deviceInfo/enable', params });

export const deviceInfoDelete = (params?: DeviceInfo | any) =>
  defHttp.get<DeviceInfo>({ url: adminPath + '/orther/device/deviceInfo/delete', params });

export const deviceInfoGetToken = (params?: DeviceInfo | any) =>
  defHttp.post<DeviceInfo>({ url: adminPath + '/orther/device/deviceInfo/getToken', params });
